export const required = (
  val: string | number | boolean | undefined,
  msg: string
) => (val !== '' && val !== 0 && val !== undefined && val !== false) || msg;
export const again = (val: string, pre: string) =>
  val === pre || '两次输入的密码不一致';
export const limitLength = (val: string, mix = 6, max = 20) =>
  (val.length >= 6 && val.length <= max) || `长度必须在${mix}到${max}之间`;
